﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TimeTracker.Comparers
{
    public class NoteComparer : IComparer<TreeNode>
    {
        #region IComparer<RadTreeNode> Members

        int IComparer<TreeNode>.Compare(TreeNode x, TreeNode y)
        {
            if (x.Tag is INote && y.Tag is INote)
            {
                return ((INote)x.Tag).Time.CompareTo(((INote)y.Tag).Time);
            }

            return 0;
        }

        #endregion
    }
  
    public class NoteComparerDescending : IComparer<TreeNode>
    {
        #region IComparer<RadTreeNode> Members

        int IComparer<TreeNode>.Compare(TreeNode x, TreeNode y)
        {
            if (x.Tag is INote && y.Tag is INote)
            {
                return ((INote)y.Tag).Time.CompareTo(((INote)x.Tag).Time);
            }

            return 0;
        }

        #endregion
    }
}
